package com.sleep.psy.external_server.business.adjustment.service.impl;

import com.sleep.psy.external_server.business.adjustment.entity.AdjustmentBaseVideoRecord;
import com.sleep.psy.external_server.business.adjustment.entity.vo.BaseRecordReq;
import com.sleep.psy.external_server.business.adjustment.mapper.AdjustmentBaseVideoRecordMapper;
import com.sleep.psy.external_server.business.adjustment.service.AdjustmentBaseVideoRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sleep.psy.external_server.result.Result;
import com.sleep.psy.external_server.result.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 基础视频、音频调节记录 服务实现类
 * </p>
 *
 * @author wenliguo
 * @since 2025-08-19
 */
@Service
public class AdjustmentBaseVideoRecordServiceImpl extends ServiceImpl<AdjustmentBaseVideoRecordMapper, AdjustmentBaseVideoRecord> implements AdjustmentBaseVideoRecordService {

    @Autowired
    private AdjustmentBaseVideoRecordMapper videoRecordMapper;

    /**
     * 增加基础音频、视频调节记录
     * @author wenliguo
     * @date 2025/8/19 14:39
     * @param req 请求
     * @return com.sleep.psy.external_server.result.Result
     */
    @Override
    public Result addRecord(BaseRecordReq req) {
        Integer id = req.getId();
        Long userId = req.getUserId();
        AdjustmentBaseVideoRecord record = new AdjustmentBaseVideoRecord();
        record.setBaseVideoId(id);
        record.setUserId(userId);
        videoRecordMapper.insert(record);
        return ResultUtil.success();
    }
}
